package it.unisa.beans;

import java.sql.Time;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
@Table(name="Route")
public class Route {
	public Route() {
		super();
	}
	
	public int getId_route() {
		return id_route;
	}
	public void setId_route(int id_route) {
		this.id_route = id_route;
	}
	public Time getTime() {
		return time;
	}
	public void setTime(Time time) {
		this.time = time;
	}
	public Set<Petroglyph> getPetroglyphs() {
		return petroglyphs;
	}
	public void setPetroglyphs(Set<Petroglyph> petroglyphs) {
		this.petroglyphs = petroglyphs;
	}
	public Set<AccountRoute> getAccountRoute() {
		return accountRoute;
	}
	public void setAccountRoute(Set<AccountRoute> accountRoute) {
		this.accountRoute = accountRoute;
	}

	@Id
	private int id_route;
	private Time time;
	@ManyToMany()
	@JoinTable(name = "cross", joinColumns = { @JoinColumn(name = "id_route") }, inverseJoinColumns = { @JoinColumn(name = "id_petroglyph") })
	private Set<Petroglyph> petroglyphs=new HashSet<Petroglyph>();
	@OneToMany(fetch = FetchType.EAGER,mappedBy="id.route")
	private Set<AccountRoute> accountRoute=new HashSet<AccountRoute>();
}
